# Contributor: Kevin Daudt <kdaudt@alpinelinux.org>
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=py3-prawcore
pkgver=2.4.0
pkgrel=0
pkgdesc="Low-level communication layer for PRAW 4+"
url="https://github.com/praw-dev/prawcore"
arch="noarch"
license="BSD-2-Clause"
depends="
	py3-requests
	"
makedepends="py3-flit-core py3-gpep517 py3-wheel py3-installer"
checkdepends="
	py3-betamax
	py3-betamax_matchers
	py3-betamax_serializers
	py3-mock
	py3-pytest
	py3-testfixtures
	"
subpackages="$pkgname-pyc"
source="https://github.com/praw-dev/prawcore/archive/v$pkgver/prawcore-v$pkgver.tar.gz"
builddir="$srcdir/prawcore-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer --dest="$pkgdir" .dist/*.whl
}

sha512sums="
6b7464e80d612de9e9cf118fa21abcca61d160150a422175353895efe89757a3e4d417122af2956c0b5aebc59de855866ea4db6af5162c8ad9ec66971edab80c  prawcore-v2.4.0.tar.gz
"
